import Vue from 'vue'
import VueAMap from 'vue-amap';

Vue.use(VueAMap);
import App from './App.vue'
import Vant from 'vant';
import 'vant/lib/vant-css/index.css';
import './assets/less.less';

import router from './router'
import store from './store';
import utils from './utils'

Vue.use(Vant);
Vue.config.productionTip = false
VueAMap.initAMapApiLoader({
    key: 'c1444d455fed516ad325cfbb251e03a8',
    plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.Geolocation','AMap.Driving'],
    v: '1.4.10'
});

router.beforeEach((to, from, next) => {
    // ...
    if (to.path != '/login' && to.path != 'main') {
        // if (!utils.checkLogin()) {
        //     next({path: '/login'})
        // } else {
        //     next();
        // }
        next();
    } else {
        next();
    }
})
window.eventBus = new Vue();
window.app = new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
